﻿Imports System.Data
Imports ADOEntityKYC
Imports ADOEntityAMLO103
Imports ADOEntity

Partial Class AMLO_SearchAmlo1_03
    Inherits Web.UI.BasePage
    Private Const strMenuCode As String = "M53"
    Dim dsAmlo As DataSet
    Dim clsDataTable As clsLINQToDataTable
    Dim AMLOEntity As AMLO103Entities
    Dim intBeforeItemIndex As Integer
    Dim clsSessionMenuRight As clsSessionMenuRight
    Dim clsFormatDate As clsDateFormat
    Dim clsMasterDropDown As clsMasterDropDown

#Region "Even From "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        chkIsLogin()
        btnSearch.Attributes.Add("onclick", "NoDoubleSubmit();")
        If (Not IsPostBack) Then

            AMLOEntity = New AMLO103Entities
            clsMasterDropDown = New clsMasterDropDown
            clsSessionMenuRight = Session("ClsMenuRight")
            dsAmlo = New DataSet()
            CreateControlMP()
            loadDropDown()
            setUserRightButton()
            setDefaultSearch()


            AMLOEntity.Dispose()
            AMLOEntity = Nothing
        Else
            dsAmlo = Session("ds")
            grdAmlo.DataSource = dsAmlo.Tables("Amlo")
            grdAmlo.DataBind()
        End If

    End Sub

    Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
        Session("ds") = dsAmlo
    End Sub
#End Region

#Region "SetForm"

    Sub resourceSet()

    End Sub
#End Region

#Region "Even Button"
    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        IsDataBind()
        SaveLogSearch()
        clearGvIndex()
    End Sub

    Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        Response.Redirect("Amlo1_03.aspx?status=Add")
    End Sub

    Protected Sub btnEdit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEdit.Click

        If Not (grdAmlo.SelectedIndex = -1) Then
            Dim txtCode As String = CType(grdAmlo.Rows(grdAmlo.SelectedIndex).FindControl("hdfRptSeq"), HiddenField).Value
            SaveLogPrint(1)
            Response.Redirect("Amlo1_03.aspx?status=Edit&code=" + txtCode)

        Else
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "clientScript", "alert('" + Resources.resValidate.nonSelectGrid + "')", True)

        End If
    End Sub

#End Region

#Region "Even GridView"

    Protected Sub grdAmlo_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdAmlo.RowDataBound
        clsFormatDate = New clsDateFormat
        If (e.Row.RowType.ToString = "DataRow") Then
            If Not (e.Row.Cells(4).Text = Nothing) Then
                e.Row.Cells(4).Text = clsFormatDate.chkDateThOrEn(clsDateFormat.enmDateCultureInfo.Th, e.Row.Cells(4).Text)
            End If

        End If
    End Sub

    Protected Sub grdAmlo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdAmlo.SelectedIndexChanged
        If (grdAmlo.SelectedIndex = intBeforeItemIndex) Then
            clearGvIndex()
        Else
            Dim txtIsDelete As String = CType(grdAmlo.Rows(grdAmlo.SelectedIndex).FindControl("Label11"), Label).Text
            Dim UserRight As clsSessionMenuRight
            UserRight = Session("clsMenuRight")
            If (UserRight.getRoleGroup > 79) Then 'กรณี Admin เข้าระบบมาเพื่อลบ
                If (txtIsDelete = "Y") Then
                    btnDelete.Text = "ยืนยันการลบ"
                    btnDelete.Attributes.Add("onclick", "return confirm('" + String.Format(Resources.resValidate.confirmDelete, IIf(grdAmlo.SelectedIndex = -1, "", grdAmlo.Rows(grdAmlo.SelectedIndex).Cells(2).Text)) + "');")
                Else
                    btnDelete.Attributes.Add("onclick", "return confirm('" + String.Format(Resources.resValidate.confirmNonReqDelete, IIf(grdAmlo.SelectedIndex = -1, "", grdAmlo.Rows(grdAmlo.SelectedIndex).Cells(2).Text)) + "');")
                End If

            ElseIf (UserRight.getRoleGroup < 80) Then 'กรณี user เข้าระบบมาเพื่อลบ
                If (txtIsDelete = "Y") Then
                    btnDelete.Text = "ยกเลิกลบ"
                    btnDelete.Attributes.Add("onclick", "return confirm('" + String.Format(Resources.resValidate.confirmCancelDelete, IIf(grdAmlo.SelectedIndex = -1, "", grdAmlo.Rows(grdAmlo.SelectedIndex).Cells(2).Text)) + "');")
                Else

                    btnDelete.Attributes.Add("onclick", "return confirm('" + String.Format(Resources.resValidate.confirmDelete, IIf(grdAmlo.SelectedIndex = -1, "", grdAmlo.Rows(grdAmlo.SelectedIndex).Cells(2).Text)) + "');")
                End If
            End If
            UserRight = Nothing

        End If
    End Sub

    Protected Sub grdAmlo_SelectedIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSelectEventArgs) Handles grdAmlo.SelectedIndexChanging
        intBeforeItemIndex = grdAmlo.SelectedIndex
    End Sub

    Protected Sub grdAmlo_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdAmlo.PageIndexChanging
        grdAmlo.PageIndex = e.NewPageIndex
        clearGvIndex()
        DataBind()
    End Sub

    Protected Sub grdAmlo_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles grdAmlo.Sorting
        Dim dt = TryCast(dsAmlo.Tables("Amlo"), DataTable)

        If dt IsNot Nothing Then

            'Sort the data.
            dt.DefaultView.Sort = e.SortExpression & " " & GetSortDirection(e.SortExpression)
            grdAmlo.DataSource = dsAmlo.Tables("Amlo")
            grdAmlo.DataBind()
            clearGvIndex()
        End If
    End Sub

#End Region

#Region " Function "

     Private Sub SaveLogPrint(ByVal index As Integer)
        Try
            Dim program As String = "M53"
            Dim desc As String = ""
            Dim strUnique As String = "033"

            clsSessionMenuRight = Session("ClsMenuRight")

            If index = 1 Then
                desc = "ค้นหาข้อมูลจาก "
                If Not (ddlBranch.SelectedIndex = 0) Then
                    desc = desc & " ส่วนงาน/สาขา " & ddlBranch.Text
                End If


                If Not (txtYear.Text = "") Then
                    desc = desc & " ปี " & txtYear.Text
                End If
                If Not (txtNo.Text = "") Then
                    desc = desc & " เลขที่ " & txtNo.Text
                End If

                If Not (txtDateStart.Text = "" And txtDateEnd.Text = "") Then
                    desc = desc & " วันที่ทำธุรกรรม " & txtDateStart.Text & " ถึง " & txtDateEnd.Text
                End If

                If Not (rdolIsComplete.SelectedValue = -1) Then
                    desc = desc & " สถานะ " & rdolIsComplete.Text
                End If


            Else
                desc = "พิมพ์ฟอร์ม แบบรายงานการทำธุรกรรมที่ใช้เงินสด"
            End If

            Dim strFullNo As String = CType(grdAmlo.Rows(grdAmlo.SelectedIndex).FindControl("hdfRptFullNo"), HiddenField).Value


            Dim clsLogTransaction As New clsLogTransaction
            clsLogTransaction.saveLogTransaction(strFullNo.Trim, clsSessionMenuRight.getUserName, index, desc, program)
            clsLogTransaction = Nothing
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

    Private Sub setUserRightButton()
        Dim col As New Collection

        col.Add(btnSearch, statusbtn.Query.ToString)
        col.Add(btnAdd, statusbtn.Add.ToString)
        col.Add(btnEdit, statusbtn.Modify.ToString)
        col.Add(btnDelete, statusbtn.delete.ToString)
        col.Add(btnPrint, statusbtn.print.ToString)
        setBtnToUserRight(col, strMenuCode, clsSessionMenuRight.getDsMenuRight)

    End Sub

    Private Sub loadDropDown()
        clsMasterDropDown = New clsMasterDropDown
        If (clsSessionMenuRight.getRoleGroup > 79) Then
            clsMasterDropDown.setBranchDdlSearch(ddlBranch, strDeptCode:="0", _
                                            strBranchCode:=clsSessionMenuRight.getBranchCode, _
                                            strRoleCode:=clsSessionMenuRight.getRoleGroup, _
                                            strZoneCode:=clsSessionMenuRight.getZoneCode, _
                                            selectData:=clsSessionMenuRight.getBranchCode)

        Else
            clsMasterDropDown.setBranchDdlSearch(ddlBranch, strDeptCode:=clsSessionMenuRight.getDeptCode, _
                                                        strBranchCode:=clsSessionMenuRight.getBranchCode, _
                                                        strRoleCode:=clsSessionMenuRight.getRoleGroup, _
                                                        strZoneCode:=clsSessionMenuRight.getZoneCode, _
                                                        selectData:=clsSessionMenuRight.getBranchCode)

        End If

    End Sub
    Public Sub setDefaultSearch()
        clsFormatDate = New clsDateFormat
        txtDateStart.Text = clsFormatDate.chkDateThOrEn(clsDateFormat.enmDateCultureInfo.Th, dteDateIsChk:=Date.Now)
        txtDateEnd.Text = clsFormatDate.chkDateThOrEn(clsDateFormat.enmDateCultureInfo.Th, dteDateIsChk:=Date.Now)
        txtYear.Text = clsFormatDate.GetYearLast(clsDateFormat.enmDateCultureInfo.Th).Substring(2, 2)


        If (clsSessionMenuRight.getRoleGroup > 79) Then
            rdoDelete.Visible = True
            ChkIsDelete.Visible = False
        ElseIf (clsSessionMenuRight.getRoleGroup < 80) Then
            rdoDelete.Visible = False
            ChkIsDelete.Visible = True
        End If

        If (clsSessionMenuRight.getRoleGroup > 59) Then
            ddlBranch.Enabled = True
        ElseIf (clsSessionMenuRight.getRoleGroup < 60) Then
            ddlBranch.Enabled = False
        End If


        rdolIsComplete.SelectedValue = -1
        rdoDelete.SelectedIndex = 0
    End Sub

    Sub CreateControlMP() 'อ้าง control ใน masterPage
        Dim img As Image = CType(Master.FindControl("imgHead"), Image)
        img.ImageUrl = "~/img/amlo01_03.jpg"
        Dim lbl As Label = CType(Master.FindControl("lblPage"), Label)
        lbl.Text = "ค้นหา ปปง.1-03"
    End Sub

    Private Sub IsDataBind()
        AMLOEntity = New AMLO103Entities
        clsDataTable = New clsLINQToDataTable
        clsFormatDate = New clsDateFormat
        Dim UserRight As clsSessionMenuRight
        UserRight = Session("clsMenuRight")

        If dsAmlo.Tables.Contains("Amlo") Then
            dsAmlo.Tables.Clear()
        End If
        Dim qryAmlo = From tblAmlo In AMLOEntity.AMLO103 Join tblAmloDetail In AMLOEntity.AMLODETAIL103 _
                      On tblAmlo.RPTSEQ Equals tblAmloDetail.RPTSEQ _
                     Group Join tblTran In AMLOEntity.MTSCTYPE3 On tblAmlo.TRANSTYPE Equals tblTran.TSCTYPEID
                      Into leftJoinAmlo = Group
                      From tblLeftAmlo In leftJoinAmlo.DefaultIfEmpty
                     Where tblAmloDetail.RPTIDX = 1 _
                     Order By tblAmlo.RPTSEQ Descending _
                   Select tblAmlo.RPTYEAR, tblAmlo.RPTREV, tblAmlo.ISSEND, tblAmlo.RPTNO, tblAmloDetail.FIRSTNAME, tblAmloDetail.LASTNAME, tblAmlo.BRANCHCODE, BranchCodeUse = "033" & tblAmlo.BRANCHCODE.Substring(0, 3), tblAmlo.ZONECODE, tblAmlo.DEPTCODE, tblAmlo.TRANSDATE, TSCTYPEID = If(tblLeftAmlo.TSCTYPEID Is Nothing, "-", tblLeftAmlo.TSCTYPEID), tblLeftAmlo.TSCTYPENAME, tblAmlo.TRANSTYPEOTHER, tblAmlo.SIGNTYPE, tblAmlo.CREATEBY, tblAmlo.UPDATEBY, tblAmlo.SAVEDATE, tblAmlo.RPTSEQ, tblAmlo.ISCOMPLETE, tblAmlo.ISDELETE, tblAmlo.ISCONFIRM

        If (UserRight.getRoleGroup > 79) Then 'เป็น admin ระบบ กับ  admin ธนาคาร
            If (rdoDelete.SelectedValue = 1) Then
                qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.ISDELETE = 1)
            ElseIf (rdoDelete.SelectedValue = 2) Then
                qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.ISCONFIRM = 1)
            End If
        ElseIf (UserRight.getRoleGroup < 80) Then 'เป็น admin ฝ่าย ลงมา
            If ChkIsDelete.Checked Then
                qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.ISCONFIRM = 0 And tbl_Amlo.ISDELETE = 1)
            Else
                qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.ISCONFIRM = 0)
            End If

        End If



        If (UserRight.getRoleGroup > 79) Then 'admin ระบบขึ้นไป
            If Not (ddlBranch.SelectedIndex = 0) Then
                qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.BRANCHCODE = ddlBranch.SelectedValue)
            End If
        ElseIf (UserRight.getRoleGroup > 69) Then 'Admin ฝ่าย

            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.DEPTCODE = UserRight.getDeptCode)
        ElseIf (UserRight.getRoleGroup > 59) Then 'Admin เขต 
            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.DEPTCODE = UserRight.getDeptCode And tbl_Amlo.ZONECODE = UserRight.getZoneCode)

        ElseIf (UserRight.getRoleGroup > 49) Then 'Admin สาขา
            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.DEPTCODE = UserRight.getDeptCode And tbl_Amlo.BRANCHCODE = ddlBranch.SelectedValue)

        ElseIf (UserRight.getRoleGroup < 50) Then 'user ทั่วไป
            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.BRANCHCODE.Contains(ddlBranch.SelectedValue) And tbl_Amlo.BRANCHCODE = UserRight.getBranchCode)

        End If



        If Not (ddlBranch.SelectedValue = "0") Then
            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.BRANCHCODE = ddlBranch.SelectedValue)
        End If

        If Not (txtYear.Text = "") Then
            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.RPTYEAR.Value = CInt(txtYear.Text))
        End If
        If Not (txtNo.Text = "") Then
            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.RPTNO.Contains(txtNo.Text))
        End If
        If Not (txtDateStart.Text = "" And txtDateEnd.Text = "") Then
            Dim strStartDate As String = clsFormatDate.chkDateThOrEn(clsDateFormat.enmDateCultureInfo.En, txtDateStart.Text)
            Dim strEndDate As String = clsFormatDate.chkDateThOrEn(clsDateFormat.enmDateCultureInfo.En, txtDateEnd.Text)
            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.TRANSDATE >= strStartDate And tbl_Amlo.TRANSDATE <= strEndDate)
        End If

        If Not (rdolIsComplete.SelectedValue = -1) Then
            qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.ISCOMPLETE = rdolIsComplete.SelectedValue)
        End If

        If Not (rdoDelete.SelectedValue = 0) Then
            If (rdoDelete.SelectedValue = 1) Then
                qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.ISDELETE = 1)
            ElseIf (rdoDelete.SelectedValue = 2) Then
                qryAmlo = qryAmlo.Where(Function(tbl_Amlo) tbl_Amlo.ISCONFIRM = 1)
            End If

        End If

        dsAmlo.Tables.Add(clsDataTable.LINQToDataTable(qryAmlo, "Amlo").Copy)
        If (qryAmlo.Count = 0) Then
            lblMsg.Visible = True
            lblTotal.Text = ""
        Else
            lblMsg.Visible = False
            lblTotal.Text = "จำนวนรายการทั้งหมด " + qryAmlo.Count.ToString + " รายการ "
        End If


        grdAmlo.DataSource = dsAmlo.Tables("Amlo")
        grdAmlo.DataBind()
        'txtYear.Text = dsRRPT.Tables("RRPT").Rows(0)("saveDate")

        clsDataTable = Nothing
        AMLOEntity = Nothing

    End Sub
    Private Sub clearGvIndex()
        grdAmlo.SelectedIndex = -1
        btnDelete.Attributes.Clear()
        btnDelete.Text = "ลบ"
    End Sub

    Private Function GetSortDirection(ByVal column As String) As String

        ' By default, set the sort direction to ascending.
        Dim sortDirection = "DESC"

        ' Retrieve the last column that was sorted.
        Dim sortExpression = TryCast(ViewState("SortExpression"), String)

        If sortExpression IsNot Nothing Then
            ' Check if the same column is being sorted.
            ' Otherwise, the default value can be returned.
            If sortExpression = column Then
                Dim lastDirection = TryCast(ViewState("SortDirection"), String)
                If lastDirection IsNot Nothing _
                  AndAlso lastDirection = "DESC" Then

                    sortDirection = "ASC"

                End If
            End If
        End If

        ' Save new values in ViewState.
        ViewState("SortDirection") = sortDirection
        ViewState("SortExpression") = column
        Return sortDirection
    End Function

    Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click
        If Not (grdAmlo.SelectedIndex = -1) Then
            Dim UserRight As clsSessionMenuRight
            UserRight = Session("clsMenuRight")
            If (UserRight.getRoleGroup > 79) Then
                Dim txtCode As String = CType(grdAmlo.Rows(grdAmlo.SelectedIndex).FindControl("hdfRptSeq"), HiddenField).Value
                Dim txtIsDelete As String = CType(grdAmlo.Rows(grdAmlo.SelectedIndex).FindControl("Label11"), Label).Text

                AMLOEntity = New AMLO103Entities
                If (txtIsDelete.Trim = "Y") Then
                    Dim qryDelete = (From tblAmlo103 In AMLOEntity.AMLO103 Where tblAmlo103.RPTSEQ = txtCode).ToList
                    qryDelete(0).ISCONFIRM = 1
                    AMLOEntity.SaveChanges()
                Else
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "clientScript", "alert('" + "ไม่สามารถลบได้ เนื่องจากไม่มีการขอลบ" + "')", True)
                End If

                IsDataBind()
                AMLOEntity = Nothing
                btnDelete.Text = "ลบ"
                clearGvIndex()
            ElseIf (UserRight.getRoleGroup < 80) Then
                Dim txtCode As String = CType(grdAmlo.Rows(grdAmlo.SelectedIndex).FindControl("hdfRptSeq"), HiddenField).Value
                AMLOEntity = New AMLO103Entities
                Dim qryDelete = (From tblAmlo103 In AMLOEntity.AMLO103 Where tblAmlo103.RPTSEQ = txtCode).ToList
                If (qryDelete(0).ISDELETE = 1) Then
                    qryDelete(0).ISDELETE = 0
                    btnDelete.Text = "ลบ"
                Else
                    qryDelete(0).ISDELETE = 1
                End If
                AMLOEntity.SaveChanges()
                UserRight = Nothing
                IsDataBind()
                AMLOEntity = Nothing
                clearGvIndex()
            End If

            'If (grdAmlo.SelectedIndex = intBeforeItemIndex) Then
            '    clearGvIndex()
            'Else
            '    btnDelete.Attributes.Add("onclick", "return confirm('" + String.Format(Resources.resValidate.confirmDelete, IIf(grdAmlo.SelectedIndex = -1, "", grdAmlo.Rows(grdAmlo.SelectedIndex).Cells(2).Text)) + "');")
            'End If
        Else
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "clientScript", "alert('" + Resources.resValidate.nonSelectGridDelete + "')", True)
        End If

    End Sub

    Protected Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click
        If Not (grdAmlo.SelectedIndex = -1) Then
            Dim txtCode As String = CType(grdAmlo.Rows(grdAmlo.SelectedIndex).FindControl("hdfRptSeq"), HiddenField).Value
            Dim param As String = "{ 'RPTSEQ' : '" & txtCode & "','RPTTYPE' : '" & "3" & "'}"
            SaveLogPrint(2)
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType, "key", "OpenWindowWithPost('frmPopupSelectPrint.aspx','width=730,height=345,left=100,top=100,resizable=yes,scrollbars=yes','Report', " + param + ");", True)
            '  Next
        Else
            Dim param As String = "{ 'RPTSEQ' : '" & "" & "','RPTTYPE' : '" & "3" & "'}"

            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType, "key", "OpenWindowWithPost('frmPopupSelectPrint.aspx','width=730,height=345,left=100,top=100,resizable=yes,scrollbars=yes','Report', " + param + ");", True)

        End If


    End Sub

    Private Sub SaveLogSearch()
        Try
            clsSessionMenuRight = Session("ClsMenuRight")
            Dim desc As String = ""



            If Not (ddlBranch.SelectedValue = "0") Then
                desc += " ส่วนงาน/สาขา - " + ddlBranch.SelectedItem.Text
            End If

            If Not (txtDateStart.Text = "") And Not (txtDateEnd.Text = "") Then
                desc += " วันที่ทำธุรกรรม - " + txtDateStart.Text + " ถึง " + txtDateEnd.Text
            End If

            If Not (txtYear.Text = "") Then
                desc += " ปี - " + txtYear.Text
            End If

            If Not (txtNo.Text = "") Then
                desc += " เลขที่ - " + txtNo.Text
            End If

            If rdolIsComplete.SelectedValue = 0 Then
                desc += " สถานะ - " + "ทั้งหมด "
            ElseIf rdolIsComplete.SelectedValue = 1 Then
                desc += " สถานะ - " + "ครบถ้วน "
            ElseIf rdolIsComplete.SelectedValue = 2 Then
                desc += " สถานะ - " + "ไม่ครบถ้วน "
            End If




            If Not desc = "" Then
                desc = "ค้นหาข้อมูลผู้ใช้งานระบบ จาก " + desc
            Else
                desc = "ค้นหาทั้งหมด "
            End If

            If rdoDelete.Visible = True Then
                If rdolIsComplete.SelectedValue = 0 Then
                    desc += " สถานะการลบ - " + "ทั้งหมด "
                ElseIf rdolIsComplete.SelectedValue = 1 Then
                    desc += " สถานะการลบ - " + "ขอลบ "
                ElseIf rdolIsComplete.SelectedValue = 2 Then
                    desc += " สถานะการลบ - " + "ยืนยันการลบ "
                End If
            End If

            If ChkIsDelete.Visible = True Then
                If ChkIsDelete.Checked = True Then
                    desc += " สถานะการลบ - " + "ขอลบ "
                End If
            End If

            Dim clsLogTransaction As New clsLogTransaction
            clsLogTransaction.saveLogTransaction("", clsSessionMenuRight.getUserName, 1, desc, "M53")
            clsLogTransaction = Nothing
        Catch ex As Exception
            Throw ex
        End Try

    End Sub
   
#End Region
End Class
